package top.onceio.core.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 从配置文件中读取属性
 */
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
public @interface Config {
    /**
     * conf.json:
     * --------
     * {
     *     "onceio": {
     *         "version":  1
     *     }
     * }
     * --------
     *
     * App.java
     * -----------
     * @Def
     * class App {
     *     @Config("onceio.version")
     *     public int version;
     *     @Config("onceio")
     *     public Map<String,Object> config;
     * }
     * -----------
     * @return path
     */
    String value();
}
